package org.examcity.util.beanconverter.custom;

import org.examcity.util.beanconverter.Factory;
import org.hibernate.Session;

public class HibernateFactory implements Factory {

	public Object newInstance(Object source, Class<?> targetClass) throws Exception {
		if (isMapped(targetClass)) {
			return getCurrentSession().get(targetClass, getId(source));
		}
		return targetClass.newInstance();
	}

	private Session getCurrentSession() {
		return null;
	}

	private boolean isMapped(Class<?> clazz) {
		return false;
	}

	private Long getId(Object v) {
		return null;
	}
}
